import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

// 全局配置
import 'amfe-flexible'
import './assets/css/reset.scss'
import './vant/vant' // 按需引入vant组件
import http from './api/config' // 引入axios
import './mock/index' // 引入mock数据

// 引入插件
import fastClick from 'fastclick' // 解决移动端300ms点击延迟的问题
import './assets/js/rem'
import VerifySlider from 'vue-verify-slider' // 滑动最右边验证
import SlideVerify from 'vue-monoplasty-slide-verify' // 滑动对齐图片验证

Vue.config.productionTip = false
fastClick.attach(document.body)
Vue.prototype.http = http // 全局挂载axios
Vue.use(VerifySlider)
Vue.use(SlideVerify)

router.beforeEach((to, from, next) => {
  // 路由发生变化修改页面title
  if (to.meta.title) {
    document.title = to.meta.title
  }
  next()
})

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
